<template>
    <div class="details-platform-content">
        <div class="platform-header">
            <el-radio-group
                v-model="activeTab"
                size="small"
                plain>
                <el-radio-button label="amb">校园实习生</el-radio-button>
                <el-radio-button label="market">掌大生活</el-radio-button>
                <el-radio-button label="bttx">补贴同学</el-radio-button>
                <el-radio-button label="washer">高校洗衣机</el-radio-button>
            </el-radio-group>
        </div>
        <div class="platform-main">
            <plt-amb
                v-show="activeTab == 'amb'"
                ref="amb" />
            <plt-market
                v-show="activeTab == 'market'"
                ref="market" />
            <plt-bttx
                v-show="activeTab == 'bttx'"
                ref="bttx" />
            <plt-washer
                v-show="activeTab == 'washer'"
                ref="washer" />
        </div>
    </div>
</template>

<script>
import pltAmb from '@/components/student-message/platform/plt-amb';
import pltMarket from '@/components/student-message/platform/plt-market';
import pltBttx from '@/components/student-message/platform/plt-bttx';
import pltWasher from '@/components/student-message/platform/plt-washer';
export default {
    components: { pltAmb, pltMarket, pltBttx, pltWasher },
    data() {
        return {
            activeTab: ''
        };
    },
    watch: {
        activeTab(val) {
            this.$refs[val].init();
        }
    },
    methods: {
        init(){
            this.activeTab = this.$route.query.pltActive ? this.$route.query.pltActive : 'amb';
            this.$refs[this.activeTab].init();
        }
    },
    mounted() {
    }
};

</script>

<style lang="less" scoped>
    .details-platform-content {
      position: absolute;
      width: 100%;
      height: 100%;
    }
    .platform-header {
      padding: 20px 20px;
    }
    .platform-main {
      height: calc(100% - 80px);
      overflow: auto;
    }
</style>
<style lang="less">
    .details-platform-content {
      .status-success {
        color: #52c41a;
        background-color: #52c41a;
      }
      .status-going {
        color: #1890ff;
        background-color: #1890ff;
      }
      .status-warn {
        color: #faad14;
        background-color: #faad14;
      }
      .status-error {
        color: #f5222d;
        background-color: #f5222d;
      }
      .status-disabled {
        color: rgba(0, 0, 0, 0.25);
        background-color: rgba(0, 0, 0, 0.25);
      }
      .empty {
        position: absolute;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        height: 240px;
        min-width: 500px;
        top:50%;
        left:50%;
        transform: translate(-50% , -50%);
        &-img {
          width: 270px;
          height: 219px;
          background-position: center;
          background-size: contain;
          background-repeat: no-repeat;
          background-image: url(//cdn.zsdx.cn/admin/images/student/empty.png);
        }
        &-msg {
          font-size: 16px;
          font-weight: 400;
          color: rgba(0, 0, 0, 0.3);
          line-height: 28px;
          padding-left: 50px;
        }
      }
    }

</style>